package com.hotel.servlet;

import java.io.IOException;
import java.sql.SQLException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.hotel.bean.Hotelinfor;
import com.hotel.service.HotelinService;
import com.hotel.service.impl.HotelinServiceImpl;
import com.hotel.util.BaseServlet;

/**
 * Servlet implementation class ProductServlet
 */
@WebServlet("/ProductServlet")
public class ProductServlet extends BaseServlet {
	private static final long serialVersionUID = 1L;
       
	public String Ui(HttpServletRequest request, HttpServletResponse response) throws SQLException {
		//接收商品id
		String pid = request.getParameter("pid");
		int hid = Integer.parseInt(request.getParameter("hid"));
		
		
		//根据商品id，查询商品信息
		HotelinService hs = new HotelinServiceImpl();
		Hotelinfor hotelinfor = hs.qureyHotelById(hid);
		request.setAttribute("hotelinfor", hotelinfor);
		
		return "/user/details.jsp";
	}
}
